\hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface}{}\section{duer\+O\+S\+Dcs\+S\+DK\+:\+:sdk\+Interfaces\+:\+:Media\+Player\+Interface Class Reference}
\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface}\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}


播放器接口。  




{\ttfamily \#include $<$Media\+Player\+Interface.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aab7cbf3d5682cc913d065922af17a310}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aab7cbf3d5682cc913d065922af17a310}} 
virtual \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aab7cbf3d5682cc913d065922af17a310}{$\sim$\+Media\+Player\+Interface} ()=default
\begin{DoxyCompactList}\small\item\em 析构函数 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abcc2b939b8e4549b1e16168d0efe36ff}{set\+Source} (std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1AttachmentReader}{Attachment\+Reader} $>$ attachment\+Reader)=0
\begin{DoxyCompactList}\small\item\em 设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a3061ab7f0867a3c8a38aad71bf06a6d1}{set\+Source} (const std\+::string \&url)=0
\begin{DoxyCompactList}\small\item\em 设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a0fb29a6364ca2586ea0328f52f19ed1a}{set\+Source} (const std\+::string \&audio\+\_\+file\+\_\+path, bool repeat)=0
\begin{DoxyCompactList}\small\item\em 设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aee790a88554e46581e17bcf0e1f8d2ec}{set\+Offset} (std\+::chrono\+::milliseconds offset)
\begin{DoxyCompactList}\small\item\em 设置播放位置偏移量。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a04f45089480e2177b42584ba51a073c0}{play} ()=0
\begin{DoxyCompactList}\small\item\em 开始播放。在播放之前需要先设置资源，如果在资源未设置情况下进行播放，将会返回错误。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ad9ddff784aa732be0a8b11706e3c9b09}{stop} ()=0
\begin{DoxyCompactList}\small\item\em 停止播放。音频播放一旦停止，重新播放将会从头开始。音频资源需要在调用stop之前设置，如果没有设置播放资源就进行stop，将会返回错误。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abb1516401c99e93714723360ef093ac9}{pause} ()=0
\begin{DoxyCompactList}\small\item\em 暂停播放。音频播放一旦暂停，调用resume()将会恢复播放。音频资源需要在调用pause之前设置，如果没有设置播放资源就进行pause，将会返回错误。 只有当音频正在播放过程中调用pause才会起作用，在其它所有状态下调用都会返回\+F\+A\+I\+L\+U\+R\+E。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_affeabe3384e46924a96cd146e3c8dba0}{resume} ()=0
\begin{DoxyCompactList}\small\item\em 恢复播放。音频资源需要在调用resume之前设置，如果没有设置播放资源就进行resume，将会返回错误。 只有当音频正在暂停时调用resume才会起作用，在其它所有状态下调用都会返回\+F\+A\+I\+L\+U\+R\+E。 \end{DoxyCompactList}\item 
virtual Media\+Player\+Status \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a90c26a82b954c116602034368351d05c}{seek\+To} (std\+::chrono\+::milliseconds offset\+In\+Milliseconds)
\begin{DoxyCompactList}\small\item\em 设置开始播放的位置。只有当播放资源设置成功后，调用seek\+To才有意义。 \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a316fbe22c527b8fcb87abbf1b43dddbf}{seek\+Able} ()
\item 
virtual std\+::chrono\+::milliseconds \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_adfd47623bde33d1a871eac3c6f0f550b}{get\+Offset} ()=0
\begin{DoxyCompactList}\small\item\em 返回当前播放时间偏移量，以毫秒为单位。 \end{DoxyCompactList}\item 
virtual void \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a4f211597d7bd34dc19df4798c486d1da}{set\+Observer} (std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerObserverInterface}{Media\+Player\+Observer\+Interface} $>$ player\+Observer)=0
\begin{DoxyCompactList}\small\item\em 设置播放器观察者，当播放状态变化时观察者会观察到相关状态变化。 \end{DoxyCompactList}\item 
virtual void \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ae2404d291dd57c667cf0734622db351f}{set\+Local\+Play\+Observer} (std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1LocalSourcePlayerInterface}{Local\+Source\+Player\+Interface} $>$ player\+Observer)
\begin{DoxyCompactList}\small\item\em 设置播放器观察者，当播放状态变化时观察者会观察到相关状态变化。 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
播放器接口。 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_adfd47623bde33d1a871eac3c6f0f550b}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_adfd47623bde33d1a871eac3c6f0f550b}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!get\+Offset@{get\+Offset}}
\index{get\+Offset@{get\+Offset}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{get\+Offset()}{getOffset()}}
{\footnotesize\ttfamily virtual std\+::chrono\+::milliseconds duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::get\+Offset (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



返回当前播放时间偏移量，以毫秒为单位。 

\begin{DoxyReturn}{Returns}
当播放器正在播放时，返回当前的播放时间偏移量；如果播放器没有处于播放状态，返回\+M\+E\+D\+I\+A\+\_\+\+P\+L\+A\+Y\+E\+R\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+O\+F\+F\+S\+E\+T。 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abb1516401c99e93714723360ef093ac9}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abb1516401c99e93714723360ef093ac9}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!pause@{pause}}
\index{pause@{pause}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{pause()}{pause()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::pause (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



暂停播放。音频播放一旦暂停，调用resume()将会恢复播放。音频资源需要在调用pause之前设置，如果没有设置播放资源就进行pause，将会返回错误。 只有当音频正在播放过程中调用pause才会起作用，在其它所有状态下调用都会返回\+F\+A\+I\+L\+U\+R\+E。 

\begin{DoxyReturn}{Returns}
{\ttfamily S\+U\+C\+C\+E\+S\+S表示播放执行成功；\+F\+A\+I\+L\+U\+R\+E表示播放执行失败；\+P\+E\+N\+D\+I\+N\+G表示正在执行，这时播放状态需要通过on\+Playback\+Started} 或on\+Playback\+Error来通知。 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a04f45089480e2177b42584ba51a073c0}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a04f45089480e2177b42584ba51a073c0}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!play@{play}}
\index{play@{play}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{play()}{play()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::play (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



开始播放。在播放之前需要先设置资源，如果在资源未设置情况下进行播放，将会返回错误。 

\begin{DoxyReturn}{Returns}
{\ttfamily S\+U\+C\+C\+E\+S\+S表示播放执行成功；\+F\+A\+I\+L\+U\+R\+E表示播放执行失败；\+P\+E\+N\+D\+I\+N\+G表示正在执行，这时播放状态需要通过on\+Playback\+Started} 或on\+Playback\+Error来通知。 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_affeabe3384e46924a96cd146e3c8dba0}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_affeabe3384e46924a96cd146e3c8dba0}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!resume@{resume}}
\index{resume@{resume}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{resume()}{resume()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::resume (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



恢复播放。音频资源需要在调用resume之前设置，如果没有设置播放资源就进行resume，将会返回错误。 只有当音频正在暂停时调用resume才会起作用，在其它所有状态下调用都会返回\+F\+A\+I\+L\+U\+R\+E。 

\begin{DoxyReturn}{Returns}
{\ttfamily S\+U\+C\+C\+E\+S\+S表示播放执行成功；\+F\+A\+I\+L\+U\+R\+E表示播放执行失败；\+P\+E\+N\+D\+I\+N\+G表示正在执行，这时播放状态需要通过on\+Playback\+Resumed} 或on\+Playback\+Error来通知。 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a316fbe22c527b8fcb87abbf1b43dddbf}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a316fbe22c527b8fcb87abbf1b43dddbf}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!seek\+Able@{seek\+Able}}
\index{seek\+Able@{seek\+Able}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{seek\+Able()}{seekAble()}}
{\footnotesize\ttfamily virtual bool duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::seek\+Able (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

当前播放曲目是否支持seek操作。 \begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a90c26a82b954c116602034368351d05c}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a90c26a82b954c116602034368351d05c}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!seek\+To@{seek\+To}}
\index{seek\+To@{seek\+To}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{seek\+To()}{seekTo()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::seek\+To (\begin{DoxyParamCaption}\item[{std\+::chrono\+::milliseconds}]{offset\+In\+Milliseconds }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



设置开始播放的位置。只有当播放资源设置成功后，调用seek\+To才有意义。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em offset\+In\+Milliseconds} & 以毫秒为单位的时间偏移量。 \begin{DoxyVerb}@return @c SUCCESS表示播放执行成功；FAILURE表示播放执行失败；PENDING表示正在执行，这时播放状态需要通过onPlaybackStarted
或onPlaybackError来通知。\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ae2404d291dd57c667cf0734622db351f}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ae2404d291dd57c667cf0734622db351f}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Local\+Play\+Observer@{set\+Local\+Play\+Observer}}
\index{set\+Local\+Play\+Observer@{set\+Local\+Play\+Observer}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Local\+Play\+Observer()}{setLocalPlayObserver()}}
{\footnotesize\ttfamily virtual void duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Local\+Play\+Observer (\begin{DoxyParamCaption}\item[{std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1LocalSourcePlayerInterface}{Local\+Source\+Player\+Interface} $>$}]{player\+Observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



设置播放器观察者，当播放状态变化时观察者会观察到相关状态变化。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em player\+Observer} & 监听播放状态变化的观察者对象. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a4f211597d7bd34dc19df4798c486d1da}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a4f211597d7bd34dc19df4798c486d1da}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Observer@{set\+Observer}}
\index{set\+Observer@{set\+Observer}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Observer()}{setObserver()}}
{\footnotesize\ttfamily virtual void duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Observer (\begin{DoxyParamCaption}\item[{std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerObserverInterface}{Media\+Player\+Observer\+Interface} $>$}]{player\+Observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



设置播放器观察者，当播放状态变化时观察者会观察到相关状态变化。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em player\+Observer} & 监听播放状态变化的观察者对象. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aee790a88554e46581e17bcf0e1f8d2ec}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_aee790a88554e46581e17bcf0e1f8d2ec}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Offset@{set\+Offset}}
\index{set\+Offset@{set\+Offset}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Offset()}{setOffset()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Offset (\begin{DoxyParamCaption}\item[{std\+::chrono\+::milliseconds}]{offset }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



设置播放位置偏移量。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em offset} & 以毫秒为单位的播放偏移值。 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily S\+U\+C\+C\+E\+S\+S表示设置成功，\+F\+A\+I\+L\+U\+R\+E表示设置失败。} 
\end{DoxyReturn}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abcc2b939b8e4549b1e16168d0efe36ff}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_abcc2b939b8e4549b1e16168d0efe36ff}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Source@{set\+Source}}
\index{set\+Source@{set\+Source}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Source()}{setSource()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Source (\begin{DoxyParamCaption}\item[{std\+::shared\+\_\+ptr$<$ \hyperlink{classduerOSDcsSDK_1_1sdkInterfaces_1_1AttachmentReader}{Attachment\+Reader} $>$}]{attachment\+Reader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em attachment\+Reader} & 该对象用于读取音频数据。 \begin{DoxyVerb}@return SUCCESS表示设置成功，反之则FAILURE。\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a3061ab7f0867a3c8a38aad71bf06a6d1}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a3061ab7f0867a3c8a38aad71bf06a6d1}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Source@{set\+Source}}
\index{set\+Source@{set\+Source}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Source()}{setSource()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Source (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{url }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em url} & 音频资源url。 \begin{DoxyVerb}@return SUCCESS表示设置成功，反之则FAILURE。\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a0fb29a6364ca2586ea0328f52f19ed1a}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_a0fb29a6364ca2586ea0328f52f19ed1a}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!set\+Source@{set\+Source}}
\index{set\+Source@{set\+Source}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{set\+Source()}{setSource()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::set\+Source (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{audio\+\_\+file\+\_\+path,  }\item[{bool}]{repeat }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



设置播放资源。在play或stop调用之前需要设置播放资源，\+Media\+Player每次只能播放一个资源。 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em audio\+\_\+file\+\_\+path} & 音频资源文件路径。 \\
\hline
\mbox{\tt in}  & {\em repeat} & 是否循环播放这个资源。 \begin{DoxyVerb}@return SUCCESS表示设置成功，反之则FAILURE。\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ad9ddff784aa732be0a8b11706e3c9b09}\label{classduerOSDcsSDK_1_1sdkInterfaces_1_1MediaPlayerInterface_ad9ddff784aa732be0a8b11706e3c9b09}} 
\index{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}!stop@{stop}}
\index{stop@{stop}!duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface@{duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface}}
\subsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily virtual Media\+Player\+Status duer\+O\+S\+Dcs\+S\+D\+K\+::sdk\+Interfaces\+::\+Media\+Player\+Interface\+::stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



停止播放。音频播放一旦停止，重新播放将会从头开始。音频资源需要在调用stop之前设置，如果没有设置播放资源就进行stop，将会返回错误。 

\begin{DoxyReturn}{Returns}
{\ttfamily S\+U\+C\+C\+E\+S\+S表示播放执行成功；\+F\+A\+I\+L\+U\+R\+E表示播放执行失败；\+P\+E\+N\+D\+I\+N\+G表示正在执行，这时播放状态需要通过on\+Playback\+Started} 或on\+Playback\+Error来通知。 
\end{DoxyReturn}
